<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <content="width=980, user-scalable=no, target-densitydpi=device-dpi"></content>
    <meta name="viewport" content="width=device-width">
    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
    <title><%= htmlWebpackPlugin.options.title %></title>
  </head>
  <body>
    <noscript>
      <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
</html>
<script>
  // window.onload=function(){
  //   (function(){            
  //     var html = document.documentElement;  
  //     var windowWidth = html.clientWidth;  
  //     html.style.fontSize = windowWidth /19.2+ 'px';   
  //   })();
  // }
  (function(win) {
    var tid;
    function refreshRem() {
      let designSize = 1920; // 设计图尺寸
      let html = document.documentElement;
      let wW = html.clientWidth;// 窗口宽度
      let rem = wW * 100 / designSize; 
      document.documentElement.style.fontSize = rem + 'px';
    }
    win.addEventListener('resize', function() {
      clearTimeout(tid);
      tid = setTimeout(refreshRem, 300);
    }, false);
    win.addEventListener('pageshow', function(e) {
      if (e.persisted) {
        clearTimeout(tid);
        tid = setTimeout(refreshRem, 300);
      }
    }, false);
    refreshRem();
  })(window);
</script>